<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
include_once("../config.inc.php");
include_once(__Admin_Path."/logincheck.php");

$arrSort = array("tolWager", "tolStake", "tolRealStake", "tolPayOff", "tolRealPayOff");
$arrBetType[1] = "特碼";
$arrBetType[4] = "正碼";
$intBetType = intval($_data["BetType"]);
if($intBetType != 1 && $intBetType != 4)$intBetType = 1;

$intSortType = intval($_data["SortType"]);
$strSQL = "select * from `bet_TodayGame1` where LottoID = 1 and Bet_Type = ".$intBetType." order by ".$arrSort[$intSortType]." desc, Number";
if(!$RS = @mysql_query($strSQL, $$_Conn)){
	$GLOBALS["errormessage"] = "Find Data Error!";
	$GLOBALS["errorhidden"] = "SQL: ".$strSQL.", \nError: ".mysql_error($$_Conn).", \nLine: ".__LINE__.", \nPage: ".__FILE__;
	ErrMsgOutputHTML("Error", "", 1);
}
?><!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> 排行榜 </title>
<link rel="stylesheet" href="/css/backend.css" type="text/css">
</head>

<body>
<form action="<?php print $_SERVER["PHP_SELF"];?>" method="Post">
<table>
<tr>
	<td><input type="radio" name="BetType" value="1" <?php if($intBetType == 1)print "checked";?>>特碼</td>
	<td><input type="radio" name="BetType" value="4" <?php if($intBetType == 4)print "checked";?>>正碼</td>
	<td colspan="3"><input type="submit"></td>
</tr>
<tr>
	<td><input type="radio" name="SortType" value="0" <?php if($intSortType == 0)print "checked";?>>注數</td>
	<td><input type="radio" name="SortType" value="1" <?php if($intSortType == 1)print "checked";?>>虛貨注金</td>
	<td><input type="radio" name="SortType" value="2" <?php if($intSortType == 2)print "checked";?>>實貨注金</td>
	<td><input type="radio" name="SortType" value="3" <?php if($intSortType == 3)print "checked";?>>虛貨派彩</td>
	<td><input type="radio" name="SortType" value="4" <?php if($intSortType == 4)print "checked";?>>實貨派彩</td>
</tr>
</table>
</form>
<table class="tborder" cellpadding="6" cellspacing="1" border="0">
<tr class="tcat">
	<td align="center" width="50">號碼</td>
	<td align="center" width="50">種類</td>
	<td align="center" width="60">注數</td>
	<td align="center" width="80">虛貨注金</td>
	<td align="center" width="80">實貨注金</td>
	<td align="center" width="80">虛貨派彩</td>
	<td align="center" width="80">實貨派彩</td>
</tr>
<?php
while($Rows = PMA_mysql_fetch_object($RS)){
?><tr class="panel">
	<td align="center"><?php print $Rows -> Number;?></td>
	<td align="center"><?php print $arrBetType[$intBetType];?></td>
	<td align="right"><?php print number_format($Rows -> tolWager);?></td>
	<td align="right"><?php print number_format($Rows -> tolStake);?></td>
	<td align="right"><?php print number_format($Rows -> tolRealStake);?></td>
	<td align="right"><?php print number_format($Rows -> tolPayOff);?></td>
	<td align="right"><?php print number_format($Rows -> tolRealPayOff);?></td>
</tr><?php
}
@mysql_close($$_Conn);
?>
</table>
</body>
</html>